package cn.sjx.modules.nbiot.entity.common;

import cn.sjx.modules.nbiot.entity.receive.ReceiveBase;
import lombok.Data;
import lombok.experimental.Accessors;

import java.net.DatagramSocket;
import java.net.InetSocketAddress;

/**
 * 业务基础属性 实体类
 *
 * @Author: sjx
 * @Date: 2019年08月31日 0031 22:49:40
 */
@Data
@Accessors(chain = true)
public class BusinessBean {

    /**
     * 发送和接收数据报包的Socket
     */
    private DatagramSocket datagramSocket;

    /**
     * IP套接字地址类
     */
    private InetSocketAddress inetSocketAddress;

    /**
     * 接收数据信息实体类
     */
    private ReceiveBase receiveMsg;

    /**
     * 接收数据原生报文信息
     */
    protected byte[] byteMessage;

    /**
     * 初始化对象
     *
     * @param datagramSocket    发送和接收数据报包的Socket
     * @param inetSocketAddress IP套接字地址类
     * @param receiveMsg        接收数据信息实体类
     * @param byteMessage       接收数据原生报文信息
     */
    public BusinessBean(DatagramSocket datagramSocket, InetSocketAddress inetSocketAddress, ReceiveBase receiveMsg, byte[] byteMessage) {
        this.datagramSocket = datagramSocket;
        this.inetSocketAddress = inetSocketAddress;
        this.receiveMsg = receiveMsg;
        this.byteMessage = byteMessage;
    }
}
